package com.itheima.pay.controller;

import cn.hutool.json.JSONObject;
import com.alipay.api.AlipayClient;
import com.alipay.api.DefaultAlipayClient;
import com.alipay.api.request.*;
import com.alipay.api.response.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RequestMapping("/alipay")
@RestController
public class aliPayController {

    @GetMapping("/trade/{orderNo}")
    public AlipayTradePrecreateResponse trade(@PathVariable String orderNo) throws Exception{
        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipaydev.com/gateway.do","2021000121643118","MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCOBSR0U/bCFCr/qg6Y3MtEo5QX6c082achhxc83yp8hSI6bFMKtOD2Bro3Av+tQlJYEJmkIUGjsJLdBG8oufws7dwxI/Ut3XkvOWn6gz7Rh/WNuTurdMHzzj46oJry6f82BEJvmmcr7zKwNvGsfk4fH+X5BmGzxpa5cs6A/jU485FKgYr1ulIO98Ifsl8OCj0MDOcGF1UB/g8/B9hg1DlphsIzsmNGy0MzTLaYcvfWb96J2Zw0SetYmafBXKfjjm7PJSJ2pwGHW47s6+3p6+KTGXpJKdHaAjG/GAnzQVV0Y9vq1JRCDmy6z2Uqj9WeIylYXlgDOgY0hZIrlEhQHzxFAgMBAAECggEAQwsWbHv+rxwKOGs1POBubNaz4J4UrzcoeOFnDOtlCSdoQyBEC3fcAwil+7ZEsKvwZ3ZesWapr/Z5PjELsLQr4aHgIqqQ4bf9r1dxOjue+hcuylq5WnVh4hBovBB5VVc1jXBxVHIVZl4jFaC6ce2mP3c1f1uN3+pN2Pnjlm1q/pjz3iFG0bcgAwWaGFRuBWZ3bFZrkvMr6JrMoclLDL8ur22+tbhi/wFSJryT2/saSvIi8JKppcRhiYurgESCJlRaWughUd9Sg05f0m4RlkIEuPX7HA09i7Fp76enqjynVLLjAy+uFv7hfI7eer5gYcfGLh8ROaL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Fuw6uUN1HAz7t9FGBolo5vIRfzRy67iF8LgTaPi2+CHEtN+LgpJ2Eblu5Vpi3mP1xU8jpuz/R91EKs8SEZn31tbkc23vp5igBnQoXIZElbvNPkZI8TIOkLE38jMx55Z8ScQuPIOLpQ0Oh349U0W+18n8B86Ayw6NGf0OJYuv7k+KvVOYD6zOOO6MVGejv78VuuYVWzF6fQIDAQAB","RSA2");
        AlipayTradePrecreateRequest request = new AlipayTradePrecreateRequest();
        request.setNotifyUrl("");
        JSONObject bizContent = new JSONObject();
        bizContent.put("out_trade_no", "20210817010101003");
        bizContent.put("total_amount", 0.01);
        bizContent.put("subject", "测试商品");
        request.setBizContent(bizContent.toString());
        AlipayTradePrecreateResponse response = alipayClient.execute(request);
        if (response.isSuccess()) {
            System.out.println("调用成功");
        } else {
            System.out.println("调用失败");
        }
        return response;
    }
    @GetMapping("/tradeCreate/{orderNo}")
    public AlipayTradeCreateResponse tradeCreate(@PathVariable String orderNo) throws Exception{
        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipaydev.com/gateway.do","2021000121643118","MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCOBSR0U/bCFCr/qg6Y3MtEo5QX6c082achhxc83yp8hSI6bFMKtOD2Bro3Av+tQlJYEJmkIUGjsJLdBG8oufws7dwxI/Ut3XkvOWn6gz7Rh/WNuTurdMHzzj46oJry6f82BEJvmmcr7zKwNvGsfk4fH+X5BmGzxpa5cs6A/jU485FKgYr1ulIO98Ifsl8OCj0MDOcGF1UB/g8/B9hg1DlphsIzsmNGy0MzTLaYcvfWb96J2Zw0SetYmafBXKfjjm7PJSJ2pwGHW47s6+3p6+KTGXpJKdHaAjG/GAnzQVV0Y9vq1JRCDmy6z2Uqj9WeIylYXlgDOgY0hZIrlEhQHzxFAgMBAAECggEAQwsWbHv+rxwKOGs1POBubNaz4J4UrzcoeOFnDOtlCSdoQyBEC3fcAwil+7ZEsKvwZ3ZesWapr/Z5PjELsLQr4a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6V7m11n9jEumD1p6wbzga5MSS78OiCpEEHF6+dzLsfDA=","json","GBK","MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0qqvKXaQBy35HC2y5YjTCZ0lqCNOv8rMCpPBuRXG3fJShy1oB4o1aRVjoUc/3hAihH5Fj1F9oHmdxMiCdfK+ZzPR2QydBFaOIf8ji/pMSb040vZ2EP4tpsP7WUVnPM7MR87SYon/ckQgFuw6uUN1HAz7t9FGBolo5vIRfzRy67iF8LgTaPi2+CHEtN+LgpJ2Eblu5Vpi3mP1xU8jpuz/R91EKs8SEZn31tbkc23vp5igBnQoXIZElbvNPkZI8TIOkLE38jMx55Z8ScQuPIOLpQ0Oh349U0W+18n8B86Ayw6NGf0OJYuv7k+KvVOYD6zOOO6MVGejv78VuuYVWzF6fQIDAQAB","RSA2");
        AlipayTradeCreateRequest request = new AlipayTradeCreateRequest();
        request.setNotifyUrl("");
        JSONObject bizContent = new JSONObject();
        bizContent.put("out_trade_no", "20210817010101003");
        bizContent.put("total_amount", 0.01);
        bizContent.put("subject", "测试商品");
        bizContent.put("buyer_id", "2088622987547051");
        request.setBizContent(bizContent.toString());
        AlipayTradeCreateResponse response = alipayClient.execute(request);
        if(response.isSuccess()){
            System.out.println("调用成功");
        } else {
            System.out.println("调用失败");
        }
        return response;
    }
    @GetMapping("/tradeQuery/{orderNo}")
    public AlipayTradeQueryResponse tradeQuery(@PathVariable String orderNo) throws Exception{
        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipaydev.com/gateway.do","2021000121643118","MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCOBSR0U/bCFCr/qg6Y3MtEo5QX6c082achhxc83yp8hSI6bFMKtOD2Bro3Av+tQlJYEJmkIUGjsJLdBG8oufws7dwxI/Ut3XkvOWn6gz7Rh/WNuTurdMHzzj46oJry6f82BEJvmmcr7zKwNvGsfk4fH+X5BmGzxpa5cs6A/jU485FKgYr1ulIO98Ifs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6dHGnuTMNaPdh1EAGQCH95Jf/BJc1IivxPm6Ea5bBCIoU/mAlUZJwM9xpJxNP9Ua/Wngg666tPuZAVZe+K7zsI7hjOdKfujtUdKbJdB4z/txnmacBxFck0F8ST2vtlAoGAK3uQ16WFI+hGi3IkIMvtI13rGM/c8ibbIGi/Q9aL21yXoK28cgyD7siuV9KLT9qUr/CeKK/fARbg7wdDtNl9Ev42+PmqIj/RYrtswoAPjmAeFugkxP8Pb1CYwkWvtgk6V7m11n9jEumD1p6wbzga5MSS78OiCpEEHF6+dzLsfDA=","json","GBK","MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0qqvKXaQBy35HC2y5YjTCZ0lqCNOv8rMCpPBuRXG3fJShy1oB4o1aRVjoUc/3hAihH5Fj1F9oHmdxMiCdfK+ZzPR2QydBFaOIf8ji/pMSb040vZ2EP4tpsP7WUVnPM7MR87SYon/ckQgFuw6uUN1HAz7t9FGBolo5vIRfzRy67iF8LgTaPi2+CHEtN+LgpJ2Eblu5Vpi3mP1xU8jpuz/R91EKs8SEZn31tbkc23vp5igBnQoXIZElbvNPkZI8TIOkLE38jMx55Z8ScQuPIOLpQ0Oh349U0W+18n8B86Ayw6NGf0OJYuv7k+KvVOYD6zOOO6MVGejv78VuuYVWzF6fQIDAQAB","RSA2");

        AlipayTradeQueryRequest request = new AlipayTradeQueryRequest();
        request.setBizContent("{" +
                "  \"out_trade_no\":\""+orderNo +
                "  \"trade_no\":\"2022080822001447050501657709\"," +
                "  \"query_options\":[" +
                "    \"trade_settle_info\"" +
                "  ]" +
                "}");
        AlipayTradeQueryResponse response = alipayClient.execute(request);
        if(response.isSuccess()){
            System.out.println("调用成功");
        } else {
            System.out.println("调用失败");
        }
        return response;
    }


    @GetMapping("/tradeRefund/{orderNo}")
    public AlipayTradeRefundResponse tradeRefund(@PathVariable String orderNo) throws Exception{
        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipaydev.com/gateway.do","2021000121643118","MIIE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Te/w4QA9/tQKBgQDRwEor1WGgFyJXJAydzbrKQHzNSzV0M+W7LttGuftYZE9qO4sz7zKv758nyskxBV2644TWBQVs14kL6sdHC+7afg+1ZdFJJJr4lPGCASiWh1HOTtQZZIClWVIIEoisH7iNPzZiw0FcDokfbeVzHpxc4vWXS/Xk3OBVqSLR/xZlgQKBgAMCMgP7H9LWGXUQqbtWCEruzPUI5gql4GOZpco7JnxqvT6dHGnuTMNaPdh1EAGQCH95Jf/BJc1IivxPm6Ea5bBCIoU/mAlUZJwM9xpJxNP9Ua/Wngg666tPuZAVZe+K7zsI7hjOdKfujtUdKbJdB4z/txnmacBxFck0F8ST2vtlAoGAK3uQ16WFI+hGi3IkIMvtI13rGM/c8ibbIGi/Q9aL21yXoK28cgyD7siuV9KLT9qUr/CeKK/fARbg7wdDtNl9Ev42+PmqIj/RYrtswoAPjmAeFugkxP8Pb1CYwkWvtgk6V7m11n9jEumD1p6wbzga5MSS78OiCpEEHF6+dzLsfDA=","json","GBK","MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0qqvKXaQBy35HC2y5YjTCZ0lqCNOv8rMCpPBuRXG3fJShy1oB4o1aRVjoUc/3hAihH5Fj1F9oHmdxMiCdfK+ZzPR2QydBFaOIf8ji/pMSb040vZ2EP4tpsP7WUVnPM7MR87SYon/ckQgFuw6uUN1HAz7t9FGBolo5vIRfzRy67iF8LgTaPi2+CHEtN+LgpJ2Eblu5Vpi3mP1xU8jpuz/R91EKs8SEZn31tbkc23vp5igBnQoXIZElbvNPkZI8TIOkLE38jMx55Z8ScQuPIOLpQ0Oh349U0W+18n8B86Ayw6NGf0OJYuv7k+KvVOYD6zOOO6MVGejv78VuuYVWzF6fQIDAQAB","RSA2");
        AlipayTradeRefundRequest request = new AlipayTradeRefundRequest();
        JSONObject bizContent = new JSONObject();
        bizContent.put("trade_no", orderNo);
        bizContent.put("refund_amount", 0.01);
        request.setBizContent(bizContent.toString());
        AlipayTradeRefundResponse response = alipayClient.execute(request);
        if(response.isSuccess()){
            System.out.println("调用成功");
        } else {
            System.out.println("调用失败");
        }
        return response;
    }
    @GetMapping("/tradeFastpayRefundQuery/{orderNo}")
    public AlipayTradeFastpayRefundQueryResponse tradeFastpayRefundQuery(@PathVariable String orderNo) throws Exception{
        AlipayClient alipayClient = new DefaultAlipayClient("https://openapi.alipaydev.com/gateway.do","2021000121643118","MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCOBSR0U/bCFCr/qg6Y3MtEo5QX6c082achhxc83yp8hSI6bFMKtOD2Bro3Av+tQlJYEJmkIUGjsJLdBG8oufws7dwxI/Ut3XkvOWn6gz7Rh/WNuTurdMHzzj46oJry6f82BEJvmmcr7zKwNvGsfk4fH+X5BmGzxpa5cs6A/jU485FKgYr1ulIO98Ifsl8OCj0MDOcGF1UB/g8/B9hg1DlphsIzsmNGy0MzTLaYcvfWb96J2Zw0SetYmafBXKfjjm7PJSJ2pwGHW47s6+3p6+KTGXpJKdHaAjG/GAnzQVV0Y9vq1JRCDmy6z2Uqj9WeIylYXlgDOgY0hZIrlEhQHzxFAgMBAAECggEAQwsWbHv+rxwKOGs1POBubNaz4J4UrzcoeOFnDOtlCSdoQyBEC3fcAwil+7ZEsKvwZ3ZesWapr/Z5PjELsLQr4aHgIqqQ4bf9r1dxOjue+hcuylq5WnVh4hBovBB5VVc1jXBxVHIVZl4jFaC6ce2mP3c1f1uN3+pN2Pnjlm1q/pjz3iFG0bcgAwWaGFRuBWZ3bFZrkvMr6JrMoclLDL8ur22+tbhi/wFSJryT2/saSvIi8JKppcRhiYurgESCJlRaWughUd9Sg05f0m4RlkIEuPX7HA09i7Fp76enqjynVLLjAy+uFv7hfI7eer5gYcfGLh8ROaLGf4IGx/zC4p3mgQKBgQDxXoVSmS262iUaYzHijyjsKi1MvSmaazSta5XxWhbhnLaZT60S2phlIVS4KRIkGPNhD9tvfBPuJm6OkCR4xLpyMgfIbjY5IZG70bqOafxwRFyWL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8ScQuPIOLpQ0Oh349U0W+18n8B86Ayw6NGf0OJYuv7k+KvVOYD6zOOO6MVGejv78VuuYVWzF6fQIDAQAB","RSA2");
        AlipayTradeFastpayRefundQueryRequest request = new AlipayTradeFastpayRefundQueryRequest();
        JSONObject bizContent = new JSONObject();

        bizContent.put("trade_no", orderNo);
        bizContent.put("out_request_no", "HZ01RF001");
        request.setBizContent(bizContent.toString());
        AlipayTradeFastpayRefundQueryResponse response = alipayClient.execute(request);
        if(response.isSuccess()){
            System.out.println("调用成功");
        } else {
            System.out.println("调用失败");
        }
        return response;
    }
}
